package backend;

public class Product {

	private String prodID;
	private String catID;
	private String subCatID;
	private String name;
	private String rank;
	private String price;
	private String imURL;
	
        public Product(String prodID){
            this.prodID=prodID;
        }

	public Product(String prodID, String catID, String subCatID, String name, String rank, String price, String imURL){
		this.prodID=prodID;
		this.catID=catID;
		this.subCatID=subCatID;
		this.name=name;
		this.rank=rank;
		this.price=price;
		this.imURL=imURL;
	}

        @Override
        public String toString(){
            return this.prodID;
        }


        @Override
        public boolean equals(Object o){
            if(o instanceof Product){
                return ((Product)o).getProdID().equals(this.prodID);
            }
            return false;
        }

        @Override
        public int hashCode() {
            return (int) (super.hashCode() * Math.pow(3, Integer.parseInt(prodID)));
        }


	public String toString2(){
		return "ProdID: "+prodID+"\nCatID: "+catID+"\nsubCatID: "+subCatID+"\nname: "+name
		+"\nrank: "+rank+"\nprice: "+price+"\nurl: "+imURL;
	}
	
	public String getProdID(){
		return this.prodID;
	}

	public String getCatID(){
		return this.catID;
	}

	public String getSubCatID(){
		return this.subCatID;
	}

	public String getName(){
		return this.name;
	}

	public String getRank(){
		return this.rank;
	}

	public String getPrice(){
		return this.price;
	}

	public String getImgURL(){
		return this.imURL;
	}

}
